<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
<form method="post" action="?m=courses&c=admin_courses&a=add" name="myform" id="myform">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
	<tr>
		<th width="80"><strong><?php echo L('classes_name')?></strong></th>
		<td><?php echo form::select($this->classes, 0, 'id="cid" name="coursestime[cid]"', L('selected'));?></td>
	</tr>
	<tr>
		<th width="80"><strong><?php echo L('courses_name')?></strong></th>
		<td><?php echo form::select($this->courses, 0, 'id="csid" name="coursestime[csid]"', L('selected'));?></td>
	</tr>
	<tr>
		<th width="80"><strong><?php echo L('coursestime_time')?></strong></th>
		<td><?php echo form::date('coursestime[ctime]', $nowtime_str, 1);?></td>
	</tr>
	<tr>
		<th width="80"><strong><?php echo L('coursestime_note')?></strong></th>
		<td><input name="coursestime[cnote]" id="cnote" class="input-text" type="text" size="50" ></td>
	</tr>
	<tr>
		<th width="80"><strong><?php echo L('is_used')?></strong></th>
		<td><?php echo form::radio(array('1'=>L('used'), '0'=>L('unused')), 1, 'name="coursestime[ctused]"');?></td>
	</tr>
	</tbody>
</table>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;
<input type="reset" value=" <?php echo L('clear')?> " class="dialog">
</form>
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$('#csid').formValidator({onshow:"<?php echo L('courses_select')?>",onfocus:"<?php echo L('courses_select')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('courses_select')?>"});
	$('#cid').formValidator({onshow:"<?php echo L('classes_select')?>",onfocus:"<?php echo L('classes_select')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('classes_select')?>"});
	$('#ctime').formValidator({onshow:"<?php echo L('coursestime_select')?>",onfocus:"<?php echo L('coursestime_select')?>",oncorrect:"<?php echo L('right')?>"});
});
</script>